package com.chennan.design.factory.simple;
/**
 * 简单工厂
 * @author chennan
 *
 */

import com.chennan.design.factory.simple.impl.CheesePizza;
import com.chennan.design.factory.simple.impl.GreekPizza;
import com.chennan.design.factory.simple.inteface.Pizza;
import com.chennan.design.factory.simple.type.PizzaType;

public class SimpleFactory {
	
	public Pizza createPizza(PizzaType type) {
		Pizza pizza=null;
		switch(type){
			case CHEESE:
				pizza=new CheesePizza();
				break;
			case GREEK:
				pizza=new GreekPizza();
				break;
		}
		return pizza;
	}
}
